
export function success(data, message) {
    return {
        code: 0,
        data,
        message
    }
}


export function error(message) {
    return {
        code: -1,
        message
    }
}

export function wrapperResponse(p, msg) {
    return p.then((data) => {
        return success(data, msg)
    }).catch((e) => error(e.message))
}